package com.atguigu.gulimall.gulimallseckill.web;

import com.atguigu.common.utils.R;
import com.atguigu.gulimall.gulimallseckill.service.SeckillService;
import com.atguigu.gulimall.gulimallseckill.to.SeckillSkuRedisTo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class SeckillController {
    @Resource
    SeckillService seckillService;

    @GetMapping("/currentSeckillSkus")
    public R currentSeckillSkus(){
        List<SeckillSkuRedisTo> list = seckillService.currentSeckillSkus();
        return R.ok().setData(list);
    }
}
